package day04;

public class ForDemo {
    public static void main(String[] args) {
        for (int times = 0; times < 5; times++) {
            System.out.println("行动是成功的阶梯");
        }
        /*
        times=0<5 true 输出 times++
        times=1<5 true 输出 times++
        times=2<5 true 输出 times++
        times=3<5 true 输出 times++
        times=4<5 true 输出 times++
        times=5<5 false 则结束for循环
         */
        System.out.println("---------------------");
        for(int mun=1;mun<=9;mun++){
            System.out.println(mun+"*9="+mun*9);
        }
        /*
        mun=1<=9 true 输出 mun++
        mun=2<=9 true 输出 mun++
        mun=3<=9 true 输出 mun++
        mun=4<=9 true 输出 mun++
        mun=5<=9 true 输出 mun++
        mun=6<=9 true 输出 mun++
        mun=7<=9 true 输出 mun++
        mun=8<=9 true 输出 mun++
        mun=9<=9 true 输出 mun++
        mun=10<=9 false 结束for循环
         */
        System.out.println("---------------------");
        for(int mun=1;mun<=9;mun+=2){
            System.out.println(mun+"*9="+mun*9);
        }
        /*
        mun=1----mun<=9----true-----输出语句块----mun+=2
        mun=3----mun<=9----true-----输出语句块----mun+=2
        mun=5----mun<=9----true-----输出语句块----mun+=2
        mun=7----mun<=9----true-----输出语句块----mun+=2
        mun=9----mun<=9----true-----输出语句块----mun+=2
        mun=11----mun<=9----false---结束for循环
         */
        System.out.println("---------------------");
        for (int mun=9;mun>=1;mun--){
            System.out.println(mun+"*9="+mun*9);
        }
        /*
        mun=1---mun<=9---true---输出语句块---mun++
        mun=2---mun<=9---true---输出语句块---mun++
        mun=3---mun<=9---true---输出语句块---mun++
        mun=4---mun<=9---true---输出语句块---mun++
        mun=5---mun<=9---true---输出语句块---mun++
        mun=6---mun<=9---true---输出语句块---mun++
        mun=7---mun<=9---true---输出语句块---mun++
        mun=8---mun<=9---true---输出语句块---mun++
        mun=9---mun<=9---true---输出语句块---mun++
        mun=10---mun<=9---false---则结束for循环
         */
        for(int a=1;a<=9;a++){

        }
    }
}
